<?php defined('SYSPATH') or die('No direct script access.');
/**
 * Basic comment model. To use it, create a model that extends this class:
 *
 *     class Model_Comment extends Sprig_Model_Comment {}
 *
 * @package    Flosee
 * @author     Andy Taylor
 * @copyright  (c) 2010 Flosee Ltd.
 * @license    GPL
 */
abstract class Sprig_Model_Comment extends Sprig {

	protected $_title_key = 'id';

	protected $_sorting = array('id' => 'asc');

	protected function _init()
	{
		$this->_fields += array(
			'id' => new Sprig_Field_Auto,
			'post' => new Sprig_Field_Integer(array(
				'empty'  => FALSE,
				'editable' => FALSE,
			)),
			'author' => new Sprig_Field_Integer(array(
				'empty'  => FALSE,
				'editable' => FALSE,
			)),
			'date' => new Sprig_Field_Timestamp(array(
				'empty' => FALSE,
				'format' => "Y-m-d H:i:s",
				'editable' => TRUE,
			)),
			'edit' => new Sprig_Field_Timestamp(array(
				'empty' => TRUE,
				'format' => "Y-m-d H:i:s",
				'editable' => TRUE,
			)),
			'status' => new Sprig_Field_Enum(array(
				'empty' => FALSE,
				'editable' => TRUE,
				'choices' => array('approved',
								   'pending',
								   'deleted',
								  ),
			)),
			'content' => new Sprig_Field_Text(array(
				'empty' => FALSE,
				'editable' => TRUE,
			)),
		);
	}
} // End Posts
